import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = () => new Vuex.Store({

  state: {
    counter: 0,
    OS: '',
    platform: '',
    products: [],
    siteConfig: {}
  },
  mutations: {
    increment (state) {
      state.counter++
    },
    setOs (state, data) {
      state.OS = data
    },
    setPlatform (state, data) {
      state.platform = data
    },
    setProducts (state, data) {
      state.products = data
    },
    setConfig (state, data) {
      state.siteConfig = data
    }
  }
})

export default store